<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>

    // 1.经过duration时间之后, fn会自动执行一次
    setTimeout(fn, duration)

    // 2.经过duration时间之后, 会重复的执行fn
    setInterval(fn, duration)

  </script>

</body>
</html>